import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/vue2',
    redirect: '/vue2/home'
  },
  {
    name: 'vue2Home',
    path: '/vue2/home',
    component: () => import('../components/HelloWorld.vue')
  }, {
    name: 'vue2About',
    path: '/vue2/about',
    component: () => import('../components/About.vue')
  }
]

const router = new VueRouter({
  base: '',
  mode: process.env.NODE_ENV === 'development' ? 'hash' : 'history',
  routes
})

export default router